From: Adel Gadllah Date: Thu, 11 Mar 2010 17:04:08 +0000 (+0100) Subject: Add get_horizontal/vertical_padding() methods X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10337 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=730e8ffdf9c4668ecbd362a3e84812c0d10e129e;p=gnome-shell.git Add get_horizontal/vertical_padding() methods Add get_horizontal_padding() and get_vertical_padding() methods, that return the total padding (LEFT+RIGHT or TOP+BOTTOM). https://bugzilla.gnome.org/show_bug.cgi?id=597983 --- diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index b0e61c7ff..76b8b1a16 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -2174,6 +2174,44 @@ st_theme_node_get_border_image (StThemeNode *node) return NULL; } +/** + * st_theme_node_get_horizontal_padding: + * @node: a #StThemeNode + * + * Gets the total horizonal padding (left + right padding) + * + * Return value: the total horizonal padding + * in pixels + */ +double +st_theme_node_get_horizontal_padding (StThemeNode *node) +{ + double padding = 0.0; + padding += st_theme_node_get_padding (node, ST_SIDE_LEFT); + padding += st_theme_node_get_padding (node, ST_SIDE_RIGHT); + + return padding; +} + +/** + * st_theme_node_get_vertical_padding: + * @node: a #StThemeNode + * + * Gets the total vertical padding (top + bottom padding) + * + * Return value: the total vertical padding + * in pixels + */ +double +st_theme_node_get_vertical_padding (StThemeNode *node) +{ + double padding = 0.0; + padding += st_theme_node_get_padding (node, ST_SIDE_TOP); + padding += st_theme_node_get_padding (node, ST_SIDE_BOTTOM); + + return padding; +} + /** * st_theme_node_get_shadow: * @node: a #StThemeNode diff --git a/src/st/st-theme-node.h b/src/st/st-theme-node.h index a33736e00..87c6884ee 100644 --- a/src/st/st-theme-node.h +++ b/src/st/st-theme-node.h @@ -129,6 +129,9 @@ void st_theme_node_get_border_color (StThemeNode *node, double st_theme_node_get_padding (StThemeNode *node, StSide side); +double st_theme_node_get_horizontal_padding (StThemeNode *node); +double st_theme_node_get_vertical_padding (StThemeNode *node); + int st_theme_node_get_width (StThemeNode *node); int st_theme_node_get_height (StThemeNode *node); int st_theme_node_get_min_width (StThemeNode *node);